package com.itheima.pinda.util;

import com.baomidou.mybatisplus.core.metadata.IPage;

import com.itheima.pinda.common.utils.PageResponse;


public class ResultUtils {

    public static PageResponse pageResult(Integer pageNum, Integer pageSize, IPage  page){

        return PageResponse.builder()
                .page(pageNum)
                .pagesize(pageSize)
                .pages(page.getPages())
                .counts(page.getSize())
                .items(page.getRecords())
                .build();
    }
}
